<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\models\Comment */

$this->title = "题解id：".$model->id;
$this->params['breadcrumbs'][] = ['label' => 'Comments', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$this->registerJsFile('@web/js/comment.js',['depends'=>['app\assets\AppAsset']]);
$this->registerJsFile('@web/js/setHeight.js',['depends'=>['app\assets\AppAsset']]);
?>
<div class="box">
<div class="comment-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('Delete', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            ['label'=>'用户','value'=>\app\models\User::findOne($model->user_id)->name],
            'question_id',
            'comment_content:ntext',
            'url',
            'comment_time',
            'class1_id',
            'class2_id',
            'like_num',
            'play_num',
            'like_ids',
            ['label'=>'是否置顶','value'=>$model->is_up==1?"是":"否"],
        ],
    ]) ?>

</div>
</div>
